fix(clang-tidy): re-enable bugprone-unused-return-value#12559
Open
vish0012 wants to merge 1 commit intoautowarefoundation:mainfrom
Open
fix(clang-tidy): re-enable bugprone-unused-return-value#12559vish0012 wants to merge 1 commit intoautowarefoundation:mainfrom
vish0012 wants to merge 1 commit intoautowarefoundation:mainfrom
Conversation
Signed-off-by: Vishal Chauhan <40782713+vish0012@users.noreply.github.com>
|
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Re-enables
bugprone-unused-return-valuein.clang-tidy-ci.The check was suppressed in #12431. This PR addresses the 2 reported errors in
system/autoware_system_monitorlisted in #12450.Refs #12450
Approach
Both errors came from Boost.Asio calls where the returned
boost::system::error_codewas ignored, even though the code already had anerror_codevariable and checked it immediately afterward.This PR assigns the returned value back to
error_code, preserving the existing logic while satisfyingbugprone-unused-return-value.Changed calls:
Affected files:
system/autoware_system_monitor/reader/traffic_reader/traffic_reader_service.cppsystem/autoware_system_monitor/src/net_monitor/net_monitor.cppHow to reproduce
From the colcon workspace root:
To check the reported errors:
Verification
Before the fix, the following 2 errors were reproduced:
After the fix,
autoware_system_monitorbuilds successfully andrun-clang-tidyreports:Notes
The only
.clang-tidy-cichange is removing the suppression line for this check:- -bugprone-unused-return-value"